//
//  UIView+Base.h
//  FashionSpring
//
//  Created by 吕飞俊 on /6/27.
//  Copyright (c) 年 润媛. All rights reserved.
//
/**
 阴影与圆角不能共存
圆角:超出面积不显示
 self.layer.masksToBounds = YES;
 
阴影:超出面积显示
 self.layer.masksToBounds = NO;
 
 方法一:在drawRect 画个圆角
 
 方法二:两个view
 父类隐藏,画阴影
 子类显示,画圆

 */

#import <UIKit/UIKit.h>

@interface UIView (lvfjHelper)

-(void)addAction:(SEL)action;

#pragma mark TopBt
-(UIButton *)crateTopBt;

-(void)toTop:(UIScrollView *)scrollView;

-(void)scrollViewEndScroll:(UIScrollView *)scrollView
            setTopBtHidden:(UIButton *)bt;

#pragma mark layer

//CornerRadius

/**通用长方形按钮圆角*/
-(void)setCommonCornerRadius;

/**setRound*/
-(void)setRound;

/**setCornerNext*/
-(void)setCornerNext;

/**setCornerRadiusSize*/
-(void)setCornerRadiusSize:(CGFloat)cornerRadius;

-(void)setCommonCornerRadiusAndBorder;
// setBorderWidth

/**
 *  设置边框
 *
 *  @param borderWidth 边框大小
 *  @param borderColor 边框颜色
 */
-(void)setBorderWidth:(CGFloat)borderWidth
          borderColor:(UIColor *)borderColor;

-(void)setBorderWidth:(CGFloat)borderWidth borderColor:(UIColor *)borderColor cornerRadius:(CGFloat)cornerRadius;

-(void)setShadowOffset:(CGSize)shadowOffset
         shadowOpacity:(CGFloat)shadowOpacity;

-(void)setShadowOffset:(CGSize)shadowOffset
         shadowOpacity:(CGFloat)shadowOpacity
          shadowRadius:(CGFloat)shadowRadius;

#pragma mark setArray
/**setArray*/
-(void)setArrayObject:(NSArray *)array;

/**getArray*/
-(NSArray *)getArrayObject;

#pragma mark getxib

/**
 *  获取Xib视图
 *
 *  @param nibName <#nibName description#>
 *  @param index   索引
 *
 *  @return <#return value description#>
 */
+(UIView *)getNibViewWithNibName:(NSString *)nibName
                           index:(NSInteger)index;

/**
 *  获取Xib第一个视图
 *
 *  @param nibName <#nibName description#>
 *
 *  @return <#return value description#>
 */
+(UIView *)getNibViewFirstWithNibName:(NSString *)nibName;

@end
